import URL from '@/config/url'
import utils from '@/utils/utils'

export default {
	
	// 获取设计师列表
	getList(params = {}) {
		let data = {
			keyword: params.keyword || '',              // *搜索关键字
			// 筛选条件
			style: params.style || '',                  // *风格
			offer_section: params.offerSection || '',   // *报价
			identity: params.identity,     // *类型(0全部,1个人设计师,2设计机构  int)
			offer_sort: params.offerSort || '',         // *价格排序(''默认, ASC从低到高, DESC从高到低)
			// 分页
			page: Number(params.page) || 1,  // 页数(默认1  int)
			pagesize: params.pagesize,       // 页码(默认10  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/designer/getList', data })
	},
	getLivePlayMessage(params = {}){
		let data = {
			trend_id:params.trend_id
		}
		return utils.uniRequest({ url: URL.BASE + '/dt/base/Trend/play', data })
	},
	getSwiperList(params = {}) {
		let data = {
			type: 1, 
			page:params.page,
			pagesize:10,
		}
		return utils.uniRequest({ url: URL.BASE + '/dt/base/Trend/getSlideList', data })
	},
	GetFollow(params = {}) {
		let data = {
			follow_user_id: Number(params.follow_user_id), 
			status:params.status
		}
		return utils.uniRequest({ url: URL.BASE + '/user/User/follow', data })
	},
	getProductList(params = {}) {
		let data = {
			trend_id: Number(params.trend_id), 
		}
		return utils.uniRequest({ url: URL.BASE + '/dt/base/Trend/getProductList', data })
	},
	// 获取设计师个人信息
	getDesigner(params = {}) {
		let data = {
			designer_id: Number(params.designerId),   // *设计师id(int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/designer/getDetail', data })
	},
	// 获取轻设计
	getDesignerviewr(params = {}) {
		let data = {
			// 分页
			page: Number(params.page) || 1,  // 页数(默认1  int)
			pagesize: params.pagesize,       // 页码(默认10  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/renovate/RenovateHouse/experiencelist', data })
	},
	
	// 关注设计师
	focusDesigner(params = {}) {
		let data = {
			designer_id: Number(params.designerId),   // *设计师id(int)
			status: params.status,                   // *状态(0关注，1取消关注  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/designer/userFollow', data })
	},
	// 选项列表
	getOptionList(params = {}) {
		let data = {
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/designer/getOptionList', data })
	},
	// 获取3d案例列表
	getDemoLists(params = {}) {
		let data = {
			designer_id: Number(params.designerId),   // *设计师id(int)
			// 筛选条件
			style: params.style,    // *风格
			area: params.area,      // *面积(90-120m²: '90,120')
			offer: params.offer,    // *报价(10-20万:10,20)
			bedroom_num:params.bedroom_num,
			is_display:params.is_display,
			// 分页
			page: Number(params.page) || 1,  // 页数(默认1  int)
			pagesize: params.pagesize,       // 页码(默认10  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/getDisplayList', data })
	},
	// 获取案例列表
	getDemoList(params = {}) {
		let data = {
			estate_id:params.estate_id, //小区id
			designer_id:params.designerId,   // *设计师id(int)
			// 筛选条件
			style: params.style,    // *风格
			area: params.area,      // *面积(90-120m²: '90,120')
			offer: params.offer,    // *报价(10-20万:10,20)
			bedroom_num:params.bedroom_num,
			is_display:params.is_display,
			is_light_design:params.is_light_design,
			house_id:params.house_id,
			// 分页
			page: Number(params.page) || 1,  // 页数(默认1  int)
			pagesize: params.pagesize,       // 页码(默认10  int)
			// is_display:params.type
		}
		console.log(data);
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/getList', data })
	},
	// 获取体验列表
	getexperience(params = {}) {
		let data = {
			// 筛选条件
			area: params.area,      // *面积(90-120m²: '90,120')
			bedroom_num:params.bedroom_num,
			// 分页
			page: Number(params.page) || 1,  // 页数(默认1  int)
			pagesize: params.pagesize,       // 页码(默认10  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/renovate/RenovateHouse/experiencelist', data })
	},
	
	// 获取案例详情
	getDemoDetail(params = {}) {
		let data = {
			case_id: Number(params.caseId),  // *案例id(int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/getDetail', data })
	},
	
	// 点赞案例
	supportDemo(params = {}) {
		let data = {
			case_id: Number(params.case_id),   // *案例id(int)
			status: Number(params.status),    // *状态(0点赞，1取消点赞  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/support', data })
	},
	
	// 获取案例评论列表
	getDemoComment(params = {}) {
		let data = {
			case_id: Number(params.case_id),   // *案例id(int)
			// 分页
			page: Number(params.page) || 1,  // 页数(默认1  int)
			pagesize: 10,       // 页码(默认10  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/getCommentList', data })
	},
	// 获取案例商品清单
	getDemoshop(params = {}) {
		let data = {
			case_id: Number(params.case_id),   // *案例id(int)
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/getProductList', data })
	},
	
	// 评论案例
	commentDemo(params = {}) {
		let data = {
			case_id: Number(params.case_id),   // *案例id(int)
			content: params.content,          // *评论内容
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/comment', data })
	},
	
	// 回复案例评论
	replyDemo(params = {}) {
		let data = {
			comment_id: Number(params.comment_id),   // *评论id
			content: params.content,                // *回复内容
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/reply', data })
	},
	// 案例删除评论
	replyDemodel(params = {}) {
		let data = {
			comment_id: params.comment_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignCase/delComment', data })
	},
	
	// 获取动态列表
	getDyncList(params = {}) {
		let data = {
			partner_id: params.partner_id,  // *设计师id(int)
			// 分页
			page: Number(params.page) || 1,  // 页数(默认1  int)
			partner_type:params.partner_type,
			type:params.type,
			pagesize: 15,       // 页码(默认10  int)
		}
		return utils.uniRequest({ url: URL.BASE + '/dt/base/Trend/getList', data })
	},
	
	// 获取动态详情
	getDyncDetail(params = {}) {
		let data = {
			trend_id: Number(params.trend_id),   // *动态id(int)
		}
		return utils.uniRequest({ url: URL.BASE + '/dt/base/Trend/getDetail', data })
	},
	// 动态点赞
	gitTrendstatus(params = {}) {
		let data = {
			trend_id: params.trend_id,
			status: params.status,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/support', data })
	},
	// 动态评论列表
	getCommentList(params = {}) {
		let data = {
			trend_id: params.trend_id,
			page: params.page,
			pageSize: 10,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/getCommentList', data })
	},
	// 动态评论
	getcomment(params = {}) {
		let data = {
			trend_id:  Number(params.trend_id),
			content: params.content,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/comment', data })
	},
	// 动态评论他人
	getcommentreply(params = {}) {
		let data = {
			comment_id: params.comment_id,
			content: params.content,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/reply', data })
	},
	// 动态删除评论
	getcommentdel(params = {}) {
		let data = {
			comment_id: params.comment_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/delComment', data })
	},
	// 首页推荐
	support(params = {}) {
		let data = {
			identity:params.identity
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/designer/getRecommendList', data })
	},
	// 首页推荐案列
	getRecommend(params = {}) {
		let data = {
		}
		return utils.uniRequest({ url: URL.BASE + '/designer/DesignCase/getRecommendList', data })
	},
	// 首页推荐动态
	getRecommendTrend(params = {}) {
		let data = {
			keyword:params.keyword,
			type: params.type,
			page:params.page,
			pagesize:params.pagesize,
		}
		return utils.uniRequest({ url: URL.BASE + '/dt/base/Trend/getList', data })
	},
	// 用户评价列表
	getcomList(params = {}) {
		let data = {
			designer_id: params.designer_id,
			page: params.page,
			type: params.type,
			pageSize: 10,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/getCommentList', data })
	},
	// 下单
	getcartadd(params = {}) {
		let data = {
			designer_id: params.designer_id,
			decoration_id:params.decoration_id,
			type:params.type,
			province_id:params.province_id,
			city_id:params.city_id,
			district_id:params.district_id,
			province:params.province,
			city:params.city,
			district:params.district,
			house_type: params.house_type,
			house_area: params.house_area,
			room_type: params.room_type,
			renovate_budget: params.renovate_budget,
			phone: params.phone,
			remark: params.remark,
			house_thumb_url: params.house_thumb_url,
			from_user_id:params.share_uid,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/create', data })
	},
	// banner
	getbanner(params = {}) {
		let data = {
			type:params.type
		}
		return utils.uniRequest({ url: URL.BASE+ '/base/banner', data })
	},
	// 列表
	getorderlist(params = {}) {
		let data = {
			status:params.status,
			keyword:params.keyword,
			page:params.page,
			pagesizes:params.pagesize,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/getList', data })
	},
	// 详情
	getorderdata(params = {}) {
		let data = {
			order_id:params.order_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/getDetail', data })
	},
	// 支付
	getorderpay(params = {}) {
		let data = {
			order_id:params.order_id,
			pay_type:params.pay_type,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/pay', data })
	},
	// 取消
	getordercancel(params = {}) {
		let data = {
			order_id:params.order_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/cancel', data })
	},
	// 完成
	getordercomplete(params = {}) {
		let data = {
			order_id:params.order_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/complete', data })
	},
	// 动态足迹列表
	getTrendTrace(params = {}) {
		let data = {
			page: params.page,
			pagesize:10
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/getTraceList', data })
	},
	// 动态足迹记录
	getTrendTracetrace(params = {}) {
		let data = {
			trend_id: params.trend_id,
			forward_id:params.forward_id
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/trace', data })
	},
	// 动态足迹删除记录
	getTrendTracedel(params = {}) {
		let data = {
			trend_id: params.trend_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/delTrace', data })
	},
	// 案例足迹列表
	getCaseTrace(params = {}) {
		let data = {
			page: params.page,
			pagesize:10
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/CaseTrace/getList', data })
	},
	// 案例足迹记录
	gettrace(params = {}) {
		let data = {
			case_id: params.case_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/CaseTrace/trace', data })
	},
	// 案例足迹删除记录
	gettracedel(params = {}) {
		let data = {
			case_id: params.case_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/CaseTrace/del', data })
	},
	// 案例分享
	getsharetrace(params = {}) {
		let data = {
			case_id: params.case_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignCase/getShareInfo', data })
	},
	// 施工队分享
	getTeamShare(params = {}) {
		let data = {
			case_id: params.case_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/builder/BuildCase/getShareInfo', data })
	},
	// 案例转发
	getforward(params = {}) {
		let data = {
			case_id: params.case_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignCase/forward', data })
	},
	// 动态转发
	gettrends(params = {}) {
		let data = {
			trend_id: params.trend_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/forward', data })
	},
	// 动态分享
	getshareTrend(params = {}) {
		let data = {
			trend_id: params.trend_id,
		}
		return utils.uniRequest({ url: URL.BASE+ '/dt/base/Trend/getShareInfo', data })
	},
	// 免费申请
	DesignApply(params = {}) {
		let data = {
			name: params.name,
			phone:params.phone
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignApply/apply', data })
	},
	// 设计报价
	DesignOffer(params = {}) {
		let data = {
			area: params.area,
			bedroom_num:params.bedroom_num,
			parlour_num: params.parlour_num,
			toilet_num:params.toilet_num,
			balcony_num: params.balcony_num,
			name: params.name,
			phone:params.phone,
			estate:params.estate
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignOffer/offer', data })
	},
	
	// 设计评价
	DesignComment(params = {}) {
		let data = {
			order_id:params.order_id,
			comment_type:params.comment_type,
			decoration_id:params.decoration_id,
			designer_id: params.designer_id,
			content: params.content,
			type:params.type,
			media: params.media,
			overall_score: params.overall_score,
			design_score:params.design_score,
			service_score: params.service_score,
			communicate_score: params.communicate_score,
			budget_score:params.budget_score,
			is_anonymous: params.is_anonymous,
		}
		return utils.uniRequest({ url: URL.BASE+ '/designer/DesignerOrder/comment', data })
	},
	// 回退
	toBackOrder(params={}){
		let data = {
			order_id:params.order_id,
			is_back:params.is_back
		}
		return utils.uniRequest({url:URL.BASE + '/designer/DesignerOrder/back',data})
	},
	
	// 确认完工
	confirmOrder(params = {}){
		let data = {
			order_id:params.order_id
		}
		return utils.uniRequest({url:URL.BASE + '/designer/DesignerOrder/complete',data})
	},
	
	// 申述单列表
	getAppealList(params = {}){
		let data = {
			page:params.page,
			pagesize:params.pagesize
		}
		return utils.uniRequest({url:URL.BASE + '/designer/DesignerOrder/getAppealList',data})
	},
	
	// 申述详情
	getAppealDetail(params = {}){
		let data = {
			appeal_id:params.appeal_id
		}
		return utils.uniRequest({url:URL.BASE + '/designer/DesignerOrder/getAppealDetail',data})
	},
	
	// 平台介入
	toIntervene(params = {}){
		let data = {
			appeal_id:params.appeal_id
		}
		return utils.uniRequest({url:URL.BASE + '/designer/DesignerOrder/platformInterpose',data})
	},
	
	// 撤回申述
	toWithdraw(params = {}){
		let data = {
			appeal_id:params.appeal_id
		}
		return utils.uniRequest({url:URL.BASE + '/designer/DesignerOrder/recallAppeal',data})
	},
	
	// 解决申述
	toResolve(params = {}){
		let data = {
			appeal_id:params.appeal_id
		}
		return utils.uniRequest({url:URL.BASE + '/designer/DesignerOrder/resolveAppeal',data})
	},
	
	// 获取动态分享小程序码参数
	getShareQrParams(params = {}){
		let data = {
			scene:params.scene
		}
		return utils.uniRequest({url:URL.BASE + '/base/Base/getWxCodeScene',data})
	},
	
	// 样板间征集
	samplecollect(params = {}){
		let data = {
			user_id: params.user_id,
			market_id: params.market_id,
			name: params.name,
			mobile: params.mobile,
			estate: params.estate,
			house_type: params.house_type
		}
		return utils.uniRequest({url:URL.BASE + '/base/SampleRoom/collect',data})
	}
}